package lab02.Test04;

/**
 * Created by lenovo on 2017/10/15.
 */
public class Staff {
    private String name;
    private String num;

    private float basicSalary;

    public Staff(String name, String num, float basicSalary) {
        this.name = name;
        this.num = num;
        this.basicSalary = basicSalary;
    }

    public Staff() {
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public void setBasicSalary(float basicSalary) {
        this.basicSalary = basicSalary;
    }

    public String getName() {
        return name;
    }

    public String getNum() {
        return num;
    }

    public void getBasicSalary() {
        System.out.println(basicSalary);
    }

    public void print() {
        System.out.println(name);
        System.out.println(num);
    }

    public float getGrowthRate(int hours) {
        float rate = (hours > 160) ? (hours - 160) * 20 : 0;
        return rate;
    }

    protected float getTotalSalary(int hours) {
        float rate = (hours > 160) ? (hours - 160) * 20 : 0;
        float total = basicSalary + rate;
        return total;
    }
}

